15. Exercise: Implement touchUp()

22 16 AAK TouchUp SC V2

Android Developer Documentation

Exercise

In this exercise you are going to implement touchUp().

  1. Implement the touchUp() method.
private fun touchUp() {
   // Reset the path so it doesn't get drawn again.
   path.reset()
}
  1. Run your code and use your finger to draw on the screen. Notice that if you rotate the device, the screen is cleared, because the drawing state is not saved. For this sample app, this is by design, to give the user a simple way to clear the screen.